﻿using SMDB_Connect.SMDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Script.Serialization;

namespace GS_OM.SMHandler
{
    /// <summary>
    /// GetProductHandler 的摘要说明
    /// </summary>
    public class GetProductHandler : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            string ID= context.Request.QueryString["ID"];
            SMDB_Mgr Mgr = new SMDB_Mgr();
            DBOPush Push = Mgr.GetPushByPushID(ID);
            List<DBOPushRes> PushRes=Mgr.GetResByPush(Push.Push_ID.ToString());
            JavaScriptSerializer jss = new JavaScriptSerializer();
            context.Response.Write(jss.Serialize(Push) + "-" + jss.Serialize(PushRes));
            context.Response.End();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}